Conversation
|
Another option would be to provide libp2p options to users who rely on FX as well, but instead of libp2p controlling the |
Yes. I'm working on this as well. It will appear as effectively a new constructor. This option allows hooking into the existing constructor. Long term, providing FX options is a lot more modular and where I want to end up. Would Celestia be interested in trying that API? Useful for me to gauge interest here :) |
9f2dd3f to
6cd7fa6
Compare
6cd7fa6 to
0e76f3d
Compare
While doing some refactoring of the p2p-forge client, I found that I wanted a way to get access to parts of the host earlier than
.New()returning. I also wanted an option I could provide the constructor that would give me the host (or peer.ID, or something else) without having to have the user explicitly pass it to me.In other words I think it's nicer to do this:
Rather than
And this change would enable the former (along with many other things as well).
The biggest downside here is that fx is really powerful and this could cause some confusing errors to users.
Another concern is that it ties us to fx as long as we support this option. But I'm not worried about this for two reasons: